import javax.xml.bind.DatatypeConverter;
import java.io.UnsupportedEncodingException;

public class Test{

	public native int Method_revc(Test_Ret retobj);
	public native int intMethod(int n);
	public native boolean booleanMethod(boolean bool);
	public native String stringMethod(String text);
	public native int intArrayMethod(int[] intArray);

	public static void main(String[] args){
		System.loadLibrary("Test");
		Test test = new Test();
		Test_Ret retobj = new Test_Ret();

		//get the string not by return
		int ret = test.Method_revc(retobj);
		String str = new String (retobj.bytearray);
		System.out.println("Method_revc:"+str);

		//other function test
		int ret_i = test.intMethod(5);
		System.out.println("intMethod:"+ret_i);

		boolean ret_bool = test.booleanMethod(true);
		System.out.println("booleanMethod: " + ret_bool);

		String ret_s = test.stringMethod("Yukin");
		System.out.println("stringMethod: " + ret_s);
		
		int ret_ia = test.intArrayMethod(new int[] { 1, 1, 2, 3, 5, 8, 13 });
		System.out.println("intArrayMethod: " + ret_ia);



	}
}
